﻿using EBA.Collections;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace EBA.Linq
{
    public interface IHitable<TEntity>
    {

        IHitable<TEntity> Where(Expression<Func<TEntity, bool>> predicate);

        IHitable<TEntity> OrderBy(string orderby);

        IHitable<TEntity> OrderBy(string[] orderby);

        IHitable<TEntity> OrderBy<TKey>(Expression<Func<TEntity, TKey>> orderby);

        IHitable<TEntity> ThenBy<TKey>(Expression<Func<TEntity, TKey>> orderby);

        IHitable<TEntity> OrderByDescending<TKey>(Expression<Func<TEntity, TKey>> orderby);

        IHitable<TEntity> ThenByDescending<TKey>(Expression<Func<TEntity, TKey>> orderby);

        bool Any();

        bool Any(Func<TEntity, bool> predicate);

        TEntity FirstOrDefault();

        TEntity FirstOrDefault(Func<TEntity, bool> predicate);

        Hits<TEntity> Fetch(int index = 1, int size = int.MaxValue);

        List<TEntity> ToList();
    }
}
